﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using Phoenix.Service;
using Phoenix.Service.Contracts;
using Phoenix.Service.Model;
using Phoenix.Common.Util;
using Phoenix.Enum;

namespace AdminSite.Controllers
{
    public class AreaController : Controller
    {
        IAreaService IArea = new AreaService();

        public ActionResult Index()
        {
            return View();
        }

        
        public ActionResult GetProvince()
        {
            IList<AreaModel> model= IArea.GetAllProvince();
           
            return Json(model,JsonRequestBehavior.AllowGet);
        }

        public ActionResult GetCity(int id)
        {
            IList<AreaModel> model = IArea.GetByParentId(id);

            return Json(model, JsonRequestBehavior.AllowGet);

        }

    }
}
